package com.woniuxy.orderassembly.dao;

import com.woniuxy.common.Result;
import com.woniuxy.form.OrderTransferForm;
import com.woniuxy.orderassembly.model.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author chestnut
 * @since 2021-05-24
 */
public interface OrderMapper extends BaseMapper<Order> {

    @Select("SELECT order_id,actual_amount,hotel_id FROM hotel_order WHERE `status`=#{status}")
    public List<OrderTransferForm> findOrderByStatus(Integer status);

    //根据订单id修改订单状态
    @Update("UPDATE hotel_order SET `status`=#{status} WHERE order_id=#{orderId}")
    public void modifyOrderStatus(@Param("status") Integer status, @Param("orderId") Integer orderId);



}
